package dt.inlee.domain;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 
 * @类名： DcUser
 * @功能说明：点餐系统訂單
 * @作者： 研发部-鄢松涛
 * @创建日期： 2014年9月19日下午3:31:41
 * @版本：1.0
 */
@Entity
@Table(name = "DC_ORDER")
public class DcOrder {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    
    @ManyToOne
    private DcUser user;//所属用户
    
    @ManyToOne
    private DcFood food;//所选食物
    
    @ManyToOne
    private DcBout bout;//所属轮次
    
    private Date createTime;//创建时间，（最后修改的时间）

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public DcUser getUser() {
        return user;
    }

    public void setUser(DcUser user) {
        this.user = user;
    }

    public DcFood getFood() {
        return food;
    }

    public void setFood(DcFood food) {
        this.food = food;
    }

    public DcBout getBout() {
        return bout;
    }

    public void setBout(DcBout bout) {
        this.bout = bout;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj != null && obj instanceof DcOrder && this.id == ((DcOrder) obj).getId()){
            return true;
        }else{
            return false;
        }
    }
    
    
}
